package com.ruleengine.compiler.impl;


import com.ruleengine.compiler.ITaskCompiler;
import com.ruleengine.compiler.exception.CompilerException;
import com.ruleengine.instruction.InstructionSet;
import com.ruleengine.task.ITask;
import com.ruleengine.task.config.TaskConfigManager;
import com.ruleengine.task.impl.WorkflowTask;

public class WorkflowTaskCompiler extends BaseCompiler<WorkflowTask> {

    /*
     * (non-Javadoc)
     * 
     * @see com.wx.workflow.engine.compiler.impl.BaseCompiler#comipleSubTask(com.wx.workflow.task.ITask)
     */
    @Override
    public void comipleSubTask(WorkflowTask task, InstructionSet instSet)
            throws CompilerException {
        // 循环编译每个子任务
        for (ITask t : task.getSubTasks()) {
            ITaskCompiler c = TaskConfigManager.getInstance().getTaskCompiler(
                    t.getTaskType());
            c.comipleTask(t, instSet);
        }
        
    }

}
